VMX: correct feature checks for MPX and XSAVES
authorJan Beulich <jbeulich@suse.com>
Wed, 7 Sep 2016 10:34:43 +0000 (12:34 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 7 Sep 2016 10:34:43 +0000 (12:34 +0200)
commit68eb1a4d92be58e26bd11d02b8e0317bd56294ac
tree11a88fc397f64c090d56a4bd5eae4fc120fa8ff0
parent021b242dc872f72f6c2ac0a421b1e6d87d62113e
VMX: correct feature checks for MPX and XSAVES

Their VMCS fields aren't tied to the respective base CPU feature flags
but instead to VMX specific ones.

Note that while the VMCS GUEST_BNDCFGS field exists if either of the
two respective features is available, MPX continues to get exposed to
guests only with both features present.

Also add the so far missing handling of
- GUEST_BNDCFGS in construct_vmcs()
- MSR_IA32_BNDCFGS in vmx_msr_{read,write}_intercept()
and mirror the extra correctness checks during MSR write to
vmx_load_msr().

Reported-by: "Rockosov, Dmitry" <dmitry.rockosov@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: "Rockosov, Dmitry" <dmitry.rockosov@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/cpuid.c
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/vmx/vmcs.h
xen/include/asm-x86/msr-index.h